import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Manage.vue'
import Login from "@/views/Login";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Manage',
    component: () => import('../views/Manage.vue'),
    redirect: "/home",
    children:[
      { path: 'Home', name: 'Home', component: () => import('../views/Home.vue') },
      { path: 'User', name: 'User', component: () => import('../views/User.vue') },
      { path: 'StayCare', name: 'StayCare', component: () => import('../views/StayCare.vue') },
      { path: 'LeaveCare', name: 'LeaveCare', component: () => import('../views/LeaveCare.vue') },
      { path: 'Bed', name: 'Bed', component: () => import('../views/Bed.vue') },
      { path: 'Leave', name: 'Leave', component: () => import('../views/Leave.vue') },
      { path: 'Serve', name: 'Serve', component: () => import('../views/Serve.vue') },
      { path: 'StayCharges', name: 'StayCharges', component: () => import('../views/StayCharges.vue') },
      { path: 'TempCharges', name: 'TempCharges', component: () => import('../views/TempCharges.vue') },
      { path: 'MonthCharges', name: 'MonthCharges', component: () => import('../views/MonthCharges.vue') },
    ]
  },
  {
    path: '/about',
    name: 'about',
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/Login.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
